import time
import threading
def singing():
    print("singing线程：",threading.currentThread())
    for i in range(10):
        print("唱歌...",i)
        time.sleep(0.5)
def dancing():
    print("dancing线程：",threading.currentThread())
    for i in range(10):
        print("跳舞...",i)
        time.sleep(0.5)        
if __name__ == '__main__': 
    # print("主线程：",threading.currentThread())
    t1 = threading.Thread(target=singing)
    t1.daemon = True    #将子线程设置为守护线程
    t1.start()
    t2 = threading.Thread(target=dancing)
    # t2.daemon = True    #将子线程设置为守护线程
    t2.start()

    
    time.sleep(2)
    print("主线程执行完毕")
    exit(0)
    print("-------abc-------")